Next | Prev | Up | Top | Contents | Index
Sharing Access to Guaranteed Files
Other processes can use a file or the hardware it resides on, even though guarantees are active. XFS never grants guarantees for the whole capacity of the I/O path; it always reserves some capacity. Non-guaranteed I/O requests are delayed within any 1-second interval until guarantees have been met, and may be executed bit by bit in smaller units, but they will finally be completed.
Once a guarantee is granted, the guarantee is uniquely identified with the file, through the I-node number, and with the process, through the process ID. However, it is possible to have the same file (I-node) open under different file descriptors. This has important implications:
- All requests from that process to that file are handled under the guarantee--even if they are issued to different file descriptors. (It is not possible for a single process to request both guaranteed and nonguaranteed I/O to the same file.)
- It is not possible for one process to have two guarantees on the same file. The second guarantee request is rejected, even if it uses a different file descriptor.
- Only the process that received a guarantee can remove the guarantee--that is, grio_remove_request() must be called from the same process ID that called grio_request().
- A rate guarantee is not shared by other processes created with fork() or sproc()--even though they may have shared access to the file descriptor used with grio_request(). Each process that wants guaranteed access must obtain its own guarantee.
The last point has the important implication that you cannot use a rate guarantee with asynchronous I/O. An input requested using aio_read() is executed by a different process than the one that requested the guaranteed rate. That read is treated as non-guaranteed, and executed on a time-available basis.
A complication can arise when a guaranteed rate is obtained by one process of a process group created with sproc(). When the PR_SDIR flag (synchronize file descriptors; see the sproc(2) reference page) is used, a rate guarantee obtained by one process of the group cannot be terminated simply by closing all file descriptors. It can be terminated explicitly, or by the time expiring, or by the whole process group terminating.
Next | Prev | Up | Top | Contents | Index